package main

import (
	"bufio"
	"fmt"
	"helloWorld/strs"
	"os"
)

func main() {
	file, err := os.Open("/Users/wangbo/GolandProjects/helloWorld/log/mongodb/mongod_20030/slog.log")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer file.Close()
	scanner := bufio.NewScanner(file)
	for scanner.Scan() {
		lineText := scanner.Text()
		jsonFromLog := strs.ParseSlowLog(lineText)
		fmt.Println(jsonFromLog)
		//strs.OpType()
		//fmt.Println(jsonFromLog)
		//json := strs.ParseJson(jsonFromLog)
		//fmt.Println(json)
	}
}
